import sys


def func(nums):
    if not nums:
        return 0
    nums.sort()
    n = len(nums)//2
    nums = nums[n:]
    result = 0
    for i in range(0, n, 2):
        result += nums[i]
    return result


if __name__ == '__main__':
    n = int(sys.stdin.readline().strip())
    nums = sys.stdin.readline().strip()
    nums = list(map(int, nums.split(' ')))
    print(func(nums))
